import { Button, Modal, Space, Tag } from "antd";

export const sysRoleTableColumns = (onEdit: any, onDelete: any) => {
  return [
    {
      title: "角色名称",
      dataIndex: "dict_name",
      key: "dict_name",
    },
    {
      title: "角色标识",
      dataIndex: "dict_id",
      key: "dict_id",
    },
    {
      title: "描述",
      dataIndex: "description",
      key: "description",
    },
    {
      title: "权限",
      dataIndex: "other",
      key: "permissions",
      render: (text: string) => {
        // 渲染逻辑将在此处暂停，直到动态权限可用
        return <span>权限将在此处显示</span>;
      },
    },
    {
      title: "状态",
      dataIndex: "del_flag",
      key: "status",
      render: (status: number) => (
        <Tag color={status === 1 ? "green" : "red"}>
          {status === 1 ? "启用" : "禁用"}
        </Tag>
      ),
    },
    {
      title: "操作",
      key: "action",
      render: (text: any, record: any) => (
        <Space size="middle">
          <Button type="link" onClick={() => onEdit("edit", record)}>
            编辑
          </Button>
          <Button type="link" danger onClick={() => onDelete(record)}>
            删除
          </Button>
        </Space>
      ),
    },
  ];
};


